package o;

import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import com.huawei.appmarket.service.installresult.control.InstallerReceiver;
import com.huawei.secure.android.common.intent.SafeIntent;
import java.util.LinkedList;
import java.util.List;

public class eau {
    private static final eau ˏ = new eau();
    private List<SafeIntent> ˋ = new LinkedList();

    private eau() {
    }

    private static boolean ॱ(SafeIntent safeIntent, SafeIntent safeIntent2) {
        return safeIntent.getAction().equals(safeIntent2.getAction());
    }

    private static boolean ˎ(SafeIntent safeIntent, SafeIntent safeIntent2) {
        String dataString = safeIntent.getDataString();
        String dataString2 = safeIntent2.getDataString();
        return (dataString == null && dataString2 == null) || (dataString != null && dataString.equals(dataString2));
    }

    private static boolean ˋ(SafeIntent safeIntent, SafeIntent safeIntent2) {
        if (safeIntent.getBooleanExtra("android.intent.extra.REPLACING", false) == safeIntent2.getBooleanExtra("android.intent.extra.REPLACING", false)) {
            return true;
        }
        return false;
    }

    private static boolean ˊ(SafeIntent safeIntent, SafeIntent safeIntent2) {
        return ॱ(safeIntent, safeIntent2) && ˎ(safeIntent, safeIntent2) && ˋ(safeIntent, safeIntent2);
    }

    private static Runnable ˏ(final Context context, final SafeIntent safeIntent, final InstallerReceiver installerReceiver) {
        return new Runnable() {
            public void run() {
                installerReceiver.onReceiveNoRepeat(context, safeIntent);
            }
        };
    }

    public static void ॱ(Context context, SafeIntent safeIntent, InstallerReceiver installerReceiver) {
        if (safeIntent.getAction() != null) {
            ˏ.ˊ(context, safeIntent, installerReceiver);
        }
    }

    private boolean ˏ(SafeIntent safeIntent) {
        for (SafeIntent ˊ : this.ˋ) {
            if (ˊ(ˊ, safeIntent)) {
                return true;
            }
        }
        return false;
    }

    private void ˎ(SafeIntent safeIntent) {
        this.ˋ.add(safeIntent);
    }

    private void ˋ(SafeIntent safeIntent) {
        this.ˋ.remove(safeIntent);
    }

    private void ˊ(Context context, SafeIntent safeIntent, InstallerReceiver installerReceiver) {
        if (safeIntent.getAction() != null && !ˏ(safeIntent)) {
            ˎ(safeIntent);
            Handler handler = new Handler(Looper.getMainLooper());
            handler.postDelayed(ˏ(context, safeIntent, installerReceiver), 100);
            handler.postDelayed(ˊ(safeIntent), 1000);
        }
    }

    private Runnable ˊ(final SafeIntent safeIntent) {
        return new Runnable(this) {
            final /* synthetic */ eau ˏ;

            public void run() {
                this.ˏ.ˋ(safeIntent);
            }
        };
    }
}
